#include <stdio.h>

void max_min(int a[], int len, int *p1, int *p2) {	
	int i;
	for (i = 1; i < len; i++) {
		if (*p1 < a[i]) {
			*p1 = a[i];
		}
		if (*p2 > a[i]) {
			*p2 = a[i];
		}
	}
}
int main() {
	int a[] = {1, 2, 3, 4, 5};
	int max, min;
	max = min = a[0];
	max_min(a, sizeof(a)/sizeof(a[0]), &max, &min);
	printf("%d %d\n", max, min); // 5 1
	return 0; 
} 






